<template>
  <div>
    <!-- 面包屑导航 -->
    <elBread></elBread>
    <!-- 列表组件 -->
    <v-list @edit="edit" class="addButton"/>
    <!-- 弹框组件 -->
    <v-dialog :isShow="isShow" :isAdd="isAdd" @cancel="cancel" ref="diaRef"/>
  </div>
</template>

<script lang="ts" setup>
import { useRoute } from "vue-router";
import { ref } from "vue";
import vList from "./list.vue";
import vDialog from "./dialog.vue";
let route = useRoute();
// 用于弹框的显示隐藏
let isShow = ref(false);
// 用于弹框编辑的显示隐藏
let isAdd = ref(true);

const addDialog = () => {
  isShow.value = true;
  isAdd.value = true;
};
const diaRef = ref<any>(null)
// 编辑事件
let edit = (uid:number)=> {
    isShow.value = true,
    // 告诉弹框你是一个编辑
    isAdd.value = false
    diaRef.value.lookup(uid)
}
</script>

<style lang="less" scoped>
.addButton {
  margin-top: 10px;
}
</style>
